<?php $this->load->view("general/header");?>

<div id="create_invoice" class="page_">
    <div class="form">              
        <div class="form_header">Ubah Data Barang Nama : <?php echo $barangDet['0']['item_name'];?></div>
        <div class="form_header_right"></div>
        
        <div class="form_header_right1"></div>
        <div class="content_data">
        <form method="post" action="<?php echo site_url("driver/edit");?>">
           
          <input type="text" name="hidO" value="<?php echo $id;?>" style="display:none"/>
          	<div class="row">
            	<div class="col1">Pegawai Pengisi</div>
                <div class="col2"><?php echo get_username($this->session->userdata("user_id"));?> 
                	
                </div>
			</div>
            <div class="row">
            	<div class="col1">Kode Barcode</div>
                <div class="col2"><input type="text" name="barcode" id="barcode" value="<?php echo $barangDet['0']['barcode_id'];?>"/> 
                	<div class="errorField"><?php echo form_error("barcode");?></div>
                </div>
			</div>
            <div class="row">
            	<div class="col1">Merk Barang</div>
                <div class="col2" id="merkPlace">
                	<select  id="merk"  name="merk">
                    		
                            <option value="" <?php if($barangDet['0']['item_merk']==""){?> selected="selected" <?php }?> >::: Pilih Merk :::</option>
                            <?php foreach ($merk as $merk1){?>
                                <option value="<?php echo $merk1['merk_name'];?>" 
                                	<?php if($barangDet['0']['item_merk']==$merk1['merk_name']){?> selected="selected" <?php }?>
                                    ><?php echo $merk1['merk_name'];?></option>
                            <?php }?>
                    </select>
                </div><img src="<?php echo base_url();?>image_tinymce/add.jpg" id="refreshimgM"/>
			</div>
            <div class="row">
            	<div class="col1">Jenis Barang</div>
                <div class="col2" id="catPlace">
                	<select name="cat">
                                                      
                             <option value="" <?php if($barangDet['0']['item_cat']==""){?> selected="selected" <?php }?> >::: Pilih kategori :::</option>
                            <?php foreach ($cat as $cat1){?>
                                <option value="<?php echo $cat1['cat_name'];?>" 
                                	<?php if($barangDet['0']['item_cat']==$cat1['cat_name']){?> selected="selected" <?php }?>
                                    ><?php echo $cat1['cat_name'];?></option>
                            <?php }?>
                    </select> 
                </div><img src="<?php echo base_url();?>image_tinymce/add.jpg" id="refreshimgC"/>
			</div>
            <div class="row">
            	<div class="col1">Nama</div>
                <div class="col2"><input type="text" name="nama_barang" value="<?php echo $barangDet['0']['item_name'];?>"/> 
                	<div class="errorField"><?php echo form_error("nama_barang");?></div>
                </div>
			</div>
            <div class="row">
            	<div class="col1">Stok</div>
                <div class="col2"><input type="text" name="stok" value="<?php echo $barangDet['0']['stok'];?>"/> 
                	<div class="errorField"><?php echo form_error("stok");?></div>
                </div>
			</div>
            
            
        </div>
        <div class="title" align="right">
          	<input type="submit" name="btnSave" value="Simpan" class="button_red" />
        </div>
        <div class="success"><?php echo (isset($success))?$success:"";?>&nbsp;</div>
        </form>
         	<div id="pager1" class="pager1">
        		<table id="background-image"> 
                    <thead> 
                        <tr> 
                        	<th>Barcode</th>
                            <th>Merk</th>
                            
                            <th>Jenis</th>
                            <th>Nama</th> 
                            <th>Stok</th>
                            <th>Action</th>
                           
                        </tr> 
                    </thead> 
                    <tbody> 
                        <?php foreach ($added as $added1){?>
                        
                        <tr>
                        	<td width="13%"><?php echo $added1['barcode_id'];?></td>
                        	<td><?php echo $added1['item_merk'];?></td>
                             
                            <td><?php echo $added1['item_cat'];?></td> 
                            <td width="13%"><?php echo $added1['item_name'];?></td> 
                            <td><?php echo $added1['stok'];?></td>
                            <td align="center" width="13%"><a href="<?php echo site_url('driver/edit/' . $added1['id'])?>">Ubah</a> | <a href="<?php echo site_url('driver/delete/'. $added1['id'])?>" onclick="return confirm('Apakah Anda ingin menghapus data <?php echo $added1['item_name'];?>?')">Hapus</a></td>
                            
                                               
                        </tr> 
                        <?php } ?>
                       
                   </tbody> 
                    
			</table> 
           </div> 
            <form>
                <img src="<?php echo base_url();?>img/first.png" class="first" title="back to first"/>
                <img src="<?php echo base_url();?>img/prev.png" class="prev" title="previous"/>
                <input type="text" class="pagedisplay"/>
                <img src="<?php echo base_url();?>img/next.png" class="next" title="next"/>
                <img src="<?php echo base_url();?>img/last.png" class="last" title="go to last"/>
               
                <select class="pagesize">
                    <option selected="selected"  value="10">10</option>
                	<option value="15">15</option>
                    
                </select>
            
        	</form>
    </div>
    <div id="dialog-form-kategori" title="Tambah Data Kategori barang">
    	<p class="validateTips">Harus diisi semua</p>
 
        <form>
        <fieldset>
            <label for="name">Nama Kategori</label>
            <input type="text" name="nameKat" id="nameKat" class="text ui-widget-content ui-corner-all" />
                            
        </fieldset>
        </form>
    </div>
	<div id="dialog-form-merk" title="Tambah Data Merk barang">
    	<p class="validateTips">Harus diisi semua</p>
 
		<form>
        <fieldset>
            <label for="name">Nama Merk</label>
            <input type="text" name="nameMerk" id="nameMerk" class="text ui-widget-content ui-corner-all" />
                            
        </fieldset>
        </form>
	</div>
</div>
<?php $this->load->view("general/footer");?>